<style>
    .insert_farmer .form-label {
        width: 70px;
        text-align: right;
    }
     .gender input{
        width:auto !important;
    }
</style>
<div class="hp-tab-newprd insert_farmer">

    <div class="newprd-s1">
        <div class="table-div">
            <?php if(isset($_GET['addr_id'])&& !empty($_GET['addr_id'])){?>
                <ul class="table-ul-li">
                    <li><a href="<?php echo base_path(); ?>farmer/list?addr_id=<?php echo $_GET['addr_id']?>">列表</a></li>
                    <?php if(user_access('add fertilizer_case')){?>
                        <li>|</li>
                        <li><a href="<?php echo base_path(); ?>farmer/add?addr_id=<?php echo $_GET['addr_id']?>" <?php if(arg(1) == "add" && !empty($_GET['addr_id'])){?>class="selected"<?php }?>>添加</a></li>
                    <?php }
                    if(arg(1) == "edit" && !empty($_GET['addr_id'])){?>
                        <li>|</li>
                        <li class="selected">详情</li>
                    <?php }?>
                </ul>
            <?php }?>
            <?php if( empty($_GET['addr_id'])) { ?>
<!--                <div class="small-input address-search">-->
<!--                    --><?php //if(user_access('view own distributor') || user_access('view all distributor')){?><!--<div class="form-label">经销商:</div>-->
<!--                    --><?php //} print render($form['distributor_name']);
//                    print render($form['select_distributor_button']);
//                    ?>
<!--                </div>-->
            <?php  } ?>
            <div class="small-select small-input column" style="clear:both">
                <div class="form-label"><span class="required">*</span>请选区域:</div><?php print render($form['address']); ?>
            </div>
            <div class="small-select max-big-input column" style="clear:both">
                <div class="form-label">详细地址:</div><?php print render($form['details']); ?>
            </div>
            <div class="small-select max-big-input column" style="clear:both">
                <div class="form-label">专项活动:</div><?php print render($form['special_activities']); ?>
            </div>
            <div class="column" style="clear:both">
                <div class="small-input small-div"><div class="form-label"><span class="required">*</span>姓名:</div><?php print render($form['farmer_name']); ?></div>
                <div class="small-div"><div class="form-label">性别:</div><div class="gender"><?php print render($form['gender']); ?></div></div>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="small-div"><div class="form-label"><span class="required">*</span>手机:</div><?php print render($form['cell']); ?></div>
                <div class="small-div"><div class="form-label">电话:</div><?php print render($form['phone']); ?></div>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="small-div"><div class="form-label">邮箱:</div><?php print render($form['email']); ?></div>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="small-div"><div class="form-label">农户类型:</div><?php print render($form['type']); ?></div>
                <div class="small-div"><div class="form-label">耕地面积:</div><?php print render($form['farm_area']); ?></div>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="small-div"><div class="form-label">土壤种类:</div><?php print render($form['soil_type']); ?></div>
                <div class="small-div"><div class="form-label">肥沃程度:</div><?php print render( $form['soil_fertility']); ?></div>
            </div>
            <div class="small-select small-input column" style="clear:both">
                <div class="form-label">备注:</div><div style="margin-left: 6em; "><?php print render($form['farmer_other']['comments']); ?></div>
            </div>
            <div class="add-submit" style="text-align: center"><?php print render($form['submit']); ?></div>
        </div>
    </div>
</div>
<?php //print_r($form); ?>
<!--!!!!!!!!!1111111111111111111111?-->
<?php // file_put_contents("C:\\Users\\zhangyan\\Desktop\\debug.log",print_r($form,true));
 print drupal_render_children($form); ?>
</div></form>
<div>
    <div class="modal fade" id="distributorModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        选择经销商
                    </h4>
                </div>
                <div class="modal-body">
                    <?php echo @render(drupal_get_form('distributor_select_list_form'),$_GET['addr_id']?$_GET['addr_id']:'');?>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default"
                            data-dismiss="modal">关闭
                    </button>

                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>
